#pragma once
#include <vector>
#include "string.h"
#include <string>
#include <iostream>
#include <stdio.h>
#include <windows.h>
#include <io.h>
#include <time.h>
#include <shellapi.h>
#include ".\dbmsException.h"
#include ".\relationalModel.h"

#pragma comment(lib,"shell32")

using namespace std;



//Class for work with database on a phisycal level
class datastore2 {
	public:
		// Function get data from table
		vector< vector<char*> > getDataFromTable (char* nameOfTable);

		// Function get names of tables in database
		vector<char*> getTables ();

		// Function get columns names in table
		vector< vector<char*> >  getColumns (char* nameOfTable);
		
		// Get columns names and types from JOIN
		vector< vector<char*> > getColumns(vector<char*> tables);

		// Void write data to table
		void setDataToTable(char* nameOfTable, vector<char*> data);

		//Refresh data table
		void refreshDataToTable(char* nameOfTable, vector< vector<char*> > table);

        // Void display results
		void displayResults( vector< vector<char*> > result);
		
		// Create table
		void createTable (char * nameOfTable, vector<char*> columns, vector<char*> columnsTypes);
		
		//Drop table
		void dropTable (char* nameOfTable);

		//Get Column type
		char* getColumnType(char* nameOfTable, char* nameOfColumn);

	private:
		// Function show all available tables
		void showTables (vector<char*> tables);

		// Function write data to column
		void setDataToColumn (char* nameOfTable, char* nameOfColumn, char* data);
		
		// Refresh write data to colum
		void refreshDataToColumn(char*nameOfTable, char* nameOfColumn, vector<char*> data);

		// function get data from one column
		vector<char*> getDataFromColumn (char* nameOfColumn, char* nameOfTable);

	
		char* nameOfColumn;
		FILE *stream;
		FILE *stream2;
	
};
